package com.kly.sc.api.application.service.user.impl;

import com.kly.sc.api.application.service.user.GreetingService;
import com.kly.user.service.UserMsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Slf4j
@Service
public class GreetingServiceImpl implements GreetingService {

    @Resource
    UserMsgService userMsgService;

    @Override
    public void merryChristmas(String userCode) {
        LocalDate ld = LocalDate.of(2023, 12, 26);
        LocalDateTime endTime = LocalDateTime.of(ld, LocalTime.MAX);
        if (endTime.isAfter(LocalDateTime.now())) {
            String message = "\uD83C\uDF84 Merry Christmas \uD83C\uDF84\n" +
                    "  \n" +
                    "On Meboo, find your Christmas sweetheart, capture her, and fulfill all your desires.\uD83D\uDE09 Let desire spread on Christmas night！\uD83D\uDC44\uD83C\uDF46\uD83C\uDF87 ";
            userMsgService.sendMessage("1113913307465977856", userCode, "RC:InfoNtf", message, message);
        }
    }
}
